/*
 * Теги
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

#define S_assert(st) ((st)?((void)0):(void)fprintf(stderr,"Assertion (soft) \"%s\" in %s:%s():%d: failed.\n",#st,__FILE__,__func__,__LINE__))

int
str_delrange(char * const s, register int start, register int end)
{
	fprintf(stderr, "%s(s=\"%.*s\", start=%d, end=%d)\n", __func__,
			strrchr(s, '\n') ? (strrchr(s, '\n') - s) : strlen(s) - 1,
			s, start, end);

	while (s[end]) {
		s[start++] = s[++end];
	}

	return 0;
}

int
remove_tags(char *p)
{
	char *p_next, *p_end_of_tag;

	if (p_next = strchr(p, '<')) {
		if (remove_tags(p_next + 1) == 1)
			return 1;
		if (p_end_of_tag = strchr(p_next, '>')) {
			while (*p_end_of_tag) {
				*p_next++ = *(++p_end_of_tag);
			}
		} else if (p_end_of_tag == NULL) {
			return 1;
		}
	}

	return 0;
}

int
count_remove(char *p)
{
	int ct = 0;
	register int i = 0;
	char *nxt, *end, *del;
	int j;

	nxt = p;
	while (nxt = strchr(nxt, '<')) {
		i = nxt - p + 1;
		S_assert(p[i - 1] == '<');
		ct = 1;
		while (p[i] != '\n' && ct > 0) {
			if (p[i] == '<') {
				ct++;
			} else if (p[i] == '>') {
				ct--;
			}
			i++;
		}

		end = p + i;
		del = nxt;
		if (ct > 0) {
			/* skip ct brackets */
			for (j = 0; j < ct; j++) {
				del = strchr(del + 1, '<');
				if (del == NULL) {
					S_assert("impossible" == true == false);
					fprintf(stderr, "%s(): p=\"%.*s\", nxt=%ld, end=%ld, "
							"del=%ld, i=%d, ct=%d j=%d\n",
							__func__, (int) strlen(p) - 1, p, nxt - p, end - p,
							del - p, i, ct, j);
					break;
				}
			}

			if (del == NULL) {
				S_assert(*end == '\n');
				del = end;
				nxt = end + 1;
			}
		}

		do {
			*del++ = *end++;
		} while (end[-1]);
	}

	return 0;
}

int
main(int argc, char **argv)
{
	char str[100002];

	fgets(str, sizeof str, stdin);
	count_remove(str);
	fputs(str, stdout);

	return 0;
}
